<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <LINK REL=StyleSheet HREF="./css/main.css" TYPE="text/css">       
    </head>
    <body>
        <div class="filler">
            <div class="bg">
                <div class="main">
                    <c:choose>
                    <c:when test="${user.isDoctor}">
                    <div class="hdr">
                        <div class="logo">
                            <img src="./imgs/logo.png"/>
                        </div>
                        <div class="hdr_content_container">
                            <div class="acct_btns" style="margin-top : 10px;">
                                <div class="acct_btn">
                                    <a href="accountSettings.jsp">Account Settings</a>
                                </div>
                                <div class="acct_btn">
                                    <a href="LoginServlet?action=logout">Log Out</a>
                                </div>
                            </div>

                            <div class="acct_btns" style="margin-top: 75px;">
                                <div class="acct_btn">
                                    <a href="doctorDashboard.jsp">Home</a>
                                </div>
                                <div class="acct_btn">
                                    <a href="plans.jsp">Plans</a>
                                </div>
                                <div class="acct_btn">
                                    <a href="patients.jsp">Patients</a>
                                </div>

                            </div>
                        </div>
                    </div>
                    </c:when>
                    <c:otherwise>
                    <div class="hdr">
                        <div class="logo">
                            <img src="./imgs/logo.png"/>
                        </div>

                        
                        <div class="hdr_content_container">
                            <div class="acct_btns" style="margin-top : 10px;">
                                <div class="acct_btn">
                                    <a href="accountSettings.jsp">Account Settings</a>
                                </div>
                                <div class="acct_btn">
                                    <a href="LoginServlet?action=logout">Log Out</a>
                                </div>
                            </div>

                            <div class="acct_btns" style="margin-top: 75px;">
                                <div class="acct_btn">
                                    <a href="dashboard.jsp">Home</a>
                                </div>
                                <div class="acct_btn">
                                    <a href="calendar.jsp">Calendar</a>
                                </div>
                                <div class="acct_btn">
                                    <a href="plans.jsp">Plans</a>
                                </div>
                                <div class="acct_btn">
                                    <a href="data.jsp">Data</a>
                                </div>
                                <div class="acct_btn">
                                    <a href="friends.jsp">Friends</a>
                                </div>

                            </div>
                        </div>
                    </div>
                    </c:otherwise>
                    </c:choose>
                    <!-- hdr -->
                    <div class="container">
                        <div id ="main_container">
                            <form name="profilePrivacyForm" action="Account?action=updateProfilePrivacy" method="post">
                                Who can view my profile?
                                <select name="privacySelect">
                                    <option value=0 >No one</option>
                                    <option value=1 >Everyone</option>
                                </select><br/>
                                <input type="submit"></input><br/><br/><br/>
                            </form>
                            <form name="accountSettingsForm" action="Account?action=updateProfileInformation" method="post">
                                Update your information: <br/>
                                First name: <input type="text" name="firstName" value="${userAccount.firstName}"></input><br/>
                                Last name: <input type="text" name="lastName" value="${userAccount.lastName}"></input><br/>
                                City: <input type="text" name="city" value="${userAccount.city}"></input><br/>
                                State: <input type="text" name="state" value="${userAccount.state}"></input><br/>
                                Country: <input type="text" name="country" value="${userAccount.country}"></input><br/>
                                Education: <input type="text" name="education" value="${userAccount.education}"></input><br/>
                                Height: <input type="text" name="height" value="${userAccount.height}"></input><br/>
                                Weight: <input type="text" name="weight" value="${userAccount.weight}"></input><br/>
                                Sex: <input type="text" name="sex" value="${userAccount.sex}"></input><br/>
                                Email: <input type="text" name="email" value="${userAccount.email}"></input><br/>
                                <input type="submit"></input><br/><br/><br/>
                            </form>
                            <form name="changePasswordForm" action="Account?action=updatePassword" method="post">
                                Change your password?<br/>
                                Old password: <input type="password" name="oldPassword"></input><br/>
                                New Password: <input type="password" name="newPassword"></input><br/>
                                Confirm Password: <input type="password" name="confirmPassword"></input><br/>
                                <input type="submit"></input><br/><br/><br/>
                            </form>
                        </div>
                    </div>
                    <!-- dashboard container -->
                </div>
                <!-- main -->
            </div>
            <!-- bg -->
        </div>
        <!-- filler -->
    </body>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
    <script type="text/javascript">
        
        window.onload = selectPrivacy(${userAccount.profilePrivacy})
        
        function selectPrivacy(privacy){
            var privacyForm = document.forms["profilePrivacyForm"];
            privacyForm.elements["privacySelect"].selectedIndex = privacy;
        }
    </script>
</html>